#include<iostream>
#include<cstring>
using namespace std;
const int N = 1e5 + 10;
int n;
int arr[N];
int main()
{
	while (cin >> n) {
		memset(arr, 0, sizeof(arr));
		int len = 1;
		arr[0] = 1;
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int t = 0;
			for (int j = 0; j < len; j++) {
				t = arr[j] * i + sum;
				arr[j] = t % 10;
				sum = t / 10;
			}
			while (sum) {
				arr[len++] = sum % 10;
				sum /= 10;
			}
		}
		for (int i = len - 1; i >= 0; i--) {
			cout << arr[i];
		}
		cout << endl;
	}
	return 0;
}